Download Latest Version DynamicArrays-1.05.zip (417.0 kB)
Email in envelope

Get an email when there's a new version of Dynamic Arrays and Hashes (Delphi, C++)

Home / Dynamic Arrays
Name Modified Size InfoDownloads / Week
Parent folder
1.05 2026-05-21
1.04 2024-10-10
1.03 2023-11-06
1.02 2003-03-09
1.01 2003-02-11
1.00 2002-10-16
Totals: 6 Items   4

📦 Dynamic Arrays and Hashes (Delphi, C++)

A high-performance library providing advanced dynamic array and hash table data structures for Delphi and C++.

This project focuses on fast in-memory data manipulation, offering functionality beyond standard containers, including optimized operations and flexible memory control.

Web site: https://sourceforge.net/projects/dynamicarrays/

Author: Andrey Romanchenko lasersquad@gmail.com


🚀 Features

Core Capabilities

  • High-performance dynamic arrays implementations
  • Advanced hash tables:
  • THash<K, V> — key-value storage
  • THash2<K1, K2, V> — dual-key storage
  • Efficient memory management and flexible allocation strategies
  • Optimized operations (including low-level/assembler optimizations for x86/x64)

Containers & Data Structures

C++

  • General purpose fast C++ container THarray<T>
  • THArraySorted<T> — maintains sorted elements for faster lookup
  • THArrayAuto<T> — automatically resizable container. Never generates an exceptions like "Index out of bounds."
  • THArrayRaw - useful for storing untyped data (considers data as bytes in memory)
  • Iterators compatible with STL

Delphi

  • THArrayG<T> - generic general purpose container
  • Old fashion set of containers like THarrayInteger, THArrayObject, THArrayInt64 and many others (all Delphi main data types are covered, see DynamicArrays.pas unit)
  • Special containers for fixed size string-like data, useful for working with databases - THArrayStringFix, THArrayAnsiStringFix.

Hashing Classes

  • THash<K, V> and THash2<K1, K2, V> store values available by one or two indexes. Indexes can be any type.
  • Fast lookup and indexing improvements using sorted arrays
  • Support for existence-only hashes (THashExists, THash2Exists)
  • Optimized IndexOf() operations through sorted backing structures

🧱 Project Structure

Typical repository layout:

dynamicarrays/
├── src/            # Core source code (Delphi + C++)
├── tests/          # Unit tests for C++ arrays and hashes
├── prj/            # Unit tests projects to run in Delphi or VisualStudio
├── docs/           # Documentation (partial)
└── build/          # build scripts for releases


⚙️ Requirements

Supported Platforms

  • Delphi - starting from Delphi7, latest versions fully supported, including Delphi 13+
  • C++
  • Visual Studio (2022+)
  • GCC (Linux)

Architecture

Dynamic Arrays can be compiled for both x86 and x64 architectures

Performance Notes

  • Designed for high-speed operations in memory
  • Uses optimized algorithms and, in some cases, low-level assembler routines
  • Improved lookup performance using sorted internal structures
  • Faster alternatives to standard containers in certain scenarios

License

Licensed under: GNU General Public License v2.0 (GPLv2)


🛠️ Installation

Option 1 — Clone repository

git clone https://git.code.sf.net/p/dynamicarrays/code.git
cd code

Option 2 — Download release

Download the latest archive from SourceForge: latest version


▶️ Usage

THArray Example

#include "DynamicArrays.h"

THArray<int> arr;
arr.Add(10);
arr.Add(20);

int value = arr[0];

THash Example

#include "DynamicArrays.h"

THash<std::string, int> hash;

hash.Add("key", 42);

int result = hash["key"];

Delphi Example

var 
 arr: THArrayG<Integer>;
 val: Integer;
begin
  arr := THArrayG<Integer>.Create;
  arr.Add(10);
  arr.Add(20);

  val := arr[1];
end;

For more usage scenarios see unit-tests in prj folder.

Source: README.md, updated 2026-05-21